#include <stdio.h>

int parity_check(const unsigned char* msg, const int msg_length) {
    int count = 0;
    for (int i = 0; i < msg_length; i++) {
        if (msg[i] != 0) {
            count++;
        }
    }
    return (count % 2) == 0;
}

int main() {
    unsigned char test1[] = { 0, 1, 0, 1, 0 };
    unsigned char test2[] = { 1, 1, 0, 1, 0 };

    printf("Test 1: %d\n", parity_check(test1, 5));
    printf("Test 2: %d\n", parity_check(test2, 5));

    return 0;
}